#ifndef SIMPLEPROTOSRV_H
#define SIMPLEPROTOSRV_H

#include <vector>
#include <typeinfo>
#include <QString>
#include <ace/Log_Msg.h>
#include <ace/Assert.h>
#include "protocol.h"
#include "protosrvmanager.h"


class SimpleProtoSrv : public ProtoSrv
{
public:
    SimpleProtoSrv(ProtocolType pt);

    void        addLong(long data);
    void        addString(const std::string &data);

    bool        getString(std::string& data,int idx) const;
    bool        getLong(long& data,int idx) const;

    int         size() const {return _data.size();}

    bool        encode(ACE_OutputCDR &cdr);
    ProtoSrv*   decode(ACE_InputCDR &cdr);
    ProtoSrv*   execute(ACE_SOCK_Stream &peer);

protected:
    bool        decode(ACE_InputCDR &cdr,SimpleProtoSrv* request);

private:
    std::vector<std::string> _data;
};

#endif // SIMPLEPROTOSRV_H
